package com.kd.juhaowan.ui.holder;

import android.annotation.SuppressLint;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.kd.juhaowan.R;
import com.kd.juhaowan.http.model.SigninModel;
import com.kd.juhaowan.ui.adapter.BaseViewHolder;
import com.kd.juhaowan.utils.GlideHelper;


import butterknife.BindView;

public class SigninViewHolder extends BaseViewHolder {




    @BindView(R.id.item_signin_bg)
    RelativeLayout bgView;

    @BindView(R.id.item_signin_double)
    TextView doubleView;

    @BindView(R.id.item_signni_day)
    TextView dayView;

    @BindView(R.id.item_signni_content)
    TextView contentView;
    @BindView(R.id.item_signni_finish)
    ImageView finishView;
    @BindView(R.id.item_signni_image)
    ImageView imageView;





    public SigninViewHolder(@NonNull View itemView) {
        super(itemView);
    }



    @SuppressLint("ResourceType")
    public void setDate(SigninModel model){
        GlideHelper.loadGoodsCover(Glide.with(getItemView()),imageView,model.getImages());
        if(model.getSigned()==1){
            bgView.setBackgroundResource(R.drawable.a2_8_bg);
            finishView.setVisibility(View.VISIBLE);
            dayView.setTextColor(getContext().getColor(R.color.white));
            contentView.setTextColor(getContext().getColor(R.color.white));
        }else{
            bgView.setBackgroundResource(R.drawable.f7_8_bg);
            finishView.setVisibility(View.GONE);
            dayView.setTextColor(getContext().getColor(R.color.login_33));
            contentView.setTextColor(getContext().getColor(R.color.c60));
        }
        doubleView.setVisibility(model.getIs_double()==1?View.VISIBLE:View.GONE);
        dayView.setText("第"+model.getNum()+"天");
        contentView.setText(model.getName());



    }


}
